<template>
  <view class="statics-item"
    :class="{'orange-back' : types == 1, 'red-back' : types == 2,'blue-back' :types == 3, 'green-back': types == 4}">
    <view class="phxx-item-content">
      <view class="top">
        <view class="cname-box">
          <view class="cname"><span class="icon-box"
              :class="{'orange-tag' : types == 1, 'red-tag' : types == 2,'blue-tag' :types == 3, 'green-tag': types == 4}"></span>{{
            title}}</view>
        </view>
      </view>
      <view class="bottom" v-for="(one, index) in itemList">
        <view class="titls" v-if="curTab==='采购'">
          <view class="">中转：{{ one.purchaserName }}</view>
        </view>
        <view class="titls" v-if="curTab==='销售'">
          <view class="">客户：{{ one.customerName }}</view>
        </view>
        <view class="titls" v-if="curTab==='销售' && orgShow">
          <view class="">所属组织：{{ one.organizationName }}</view>
        </view>
        <view class="items">
          <view class="contens" v-if="curTab==='采购'">
            <view class="">{{ one.loadingSiteName }}</view>
            <view class="line">|</view>
            <view class="">{{ one.coalName }}</view>
          </view>
          <view class="contens" v-if="curTab==='销售'">
            <view class="">{{ one.coalName }}</view>
          </view>
          <view class="til"><span class="num-icon"
              :class="{'orange-text' : types == 1, 'red-text' : types == 2,'blue-text' :types == 3, 'green-text': types == 4}">{{
              one.vehicles }}</span>辆</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'row-number',
    props: {
      title: {
        type: String
      },
      itemList: {
        type: Array
      },
      types: {
        type: Number
      },
      curTab: {
        type: String
      },
      orgShow: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        mainDatas: []
      }
    },
    async onShow() {
    },
    methods: {
      examine() {

      },
      queueRule() {

      },
      handleClick(item, type) {
        console.log(item);
        this.$emit('manualCalling', item, type);
      },
      confirmReceipt(item) {
        this.$modal.confirm('确认收货后，司机将前往空磅称皮').then(() => {
          this.$emit('showButton', item);
        });
      }
    }
  };
</script>

<style lang="scss" scoped>
  .orange-tag {
    background-color: #F78600;
  }

  .red-tag {
    background-color: #FF4D4F;
  }

  .blue-tag {
    background-color: #409EFE;
  }

  .green-tag {
    background-color: #27B57D;
  }

  .orange-text {
    color: #F78600;
  }

  .red-text {
    color: #FF4D4F;
  }

  .blue-text {
    color: #409EFE;
  }

  .green-text {
    color: #27B57D;
  }
</style>